package com.mattgarner.jaddas.cli;

public class ClientConfigurationManager {
   private static ClientConfigurationManager instance;
   
   private String serverAddress = "127.0.0.1";
   private int serverPort = 8412;
   private String sharedKey = "qIm1k0Zi044faj4t";
   private String stringEncoding = "UTF-8";
   private int maxReconnectAttempts = 5;
   
   public final static int COMPRESSION_NONE = 0;
   public final static int COMPRESSION_GZIP = 1;
   public final static int COMPRESSION_LZIP = 2;
   private int compressionMode = COMPRESSION_NONE;
   
   // constructor
   public ClientConfigurationManager() {
	   
   }
   
	// singleton method
	public static ClientConfigurationManager getInstance() {
		if(instance == null) { 
			instance = new ClientConfigurationManager();
		}
		return instance;
	}

	public final void setCompressionMode(int algorithm) {
		compressionMode = algorithm;
	}
	
	// getters
	public final String getServerAddress() {
		return serverAddress;
	}
	
	public final int getServerPort() {
		return serverPort;
	}
	
	public final String getAuthSharedKey() {
		return sharedKey;
	}
	
	public final String getStringEncoding() {
		return stringEncoding;
	}
	
	public final int getCompressionMode() {
		return compressionMode;
	}
	
	public final int getMaxReconnectAttempts() {
		return maxReconnectAttempts;
	}
}
